package com.deng.api.controller;

import com.deng.api.entity.SysLog;
import com.deng.api.service.ISysLogService;
import com.deng.api.vo.PageVO;
import com.deng.commons.common.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 系统操作日志表 前端控制器
 * </p>
 *
 * @author deng
 * @since 2022-08-10
 */
@RestController
@Api(tags = "日志管理接口")
@RequestMapping("/api/logs")
public class SysLogController {
    @Resource
    private ISysLogService iSysLogService;

    @ApiOperation("查询所有日志")
    @GetMapping("/all")
    public BaseResult getAll(Integer size, Integer page, SysLog sysLog){
        PageVO pageVO = iSysLogService.getAll(page, size, sysLog);
        return BaseResult.success(pageVO);
    }

    @ApiOperation("异常日志")
    @GetMapping("/error")
    public BaseResult getError(Integer size, Integer page, SysLog sysLog){
        return BaseResult.success();
    }
}
